package com.fzh.service;


import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class server {

    public static List<Socket> onLineSockets=new ArrayList<>();
    public server() throws IOException {
        ServerSocket serverSocket=new ServerSocket(9999);

        System.out.println("---服务端启动成功---");

        while(true){

            Socket socket=serverSocket.accept();

            onLineSockets.add(socket);

            new ServerReadThread(socket).start();
        }
    }
}
